package com.framework.common.util;

import org.jasypt.util.text.BasicTextEncryptor;

/**
 * 用于生成加密字符串
 */
public class EncryptorUtils {
    public static String encrypt(String value, String password) {
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        textEncryptor.setPassword(password);
        return textEncryptor.encrypt(value);
    }

    public static String decrypt(String value, String password) {
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        textEncryptor.setPassword(password);
        return textEncryptor.decrypt(value);
    }
}
